﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
using OpenTK.Graphics.OpenGL;

namespace AirHockey
{
    public class Texture
    {
        #region Members
        private int id;
        private string filePath;
        #endregion

        #region Properties
        public int Id
        {
            get { return id; }
        }

        public string FilePath
        {
            get { return filePath; }
        }
        #endregion

        #region Constructor
        public Texture(string fileName)
        {
            string executableName = Application.ExecutablePath;
            FileInfo executableFileInfo = new FileInfo(executableName);
            string executableDirectoryName = executableFileInfo.DirectoryName + "\\Models";

            filePath = executableDirectoryName + "\\" + fileName;

            id = GraphicsUtilities.LoadTexture(filePath);
        }
        #endregion

        #region Public Method
        public void RemoveTexture()
        {
            GL.DeleteTexture(id);
        }
        #endregion

    }
}
